#!/usr/bin/env node

//jpg binary image file ==> base64 string

const fs = require('fs'),
      http = require('http');

const buf = fs.readFileSync('./qr-code.jpg');
const img_base64 = buf.toString('base64');

//console.log(buf);
//console.log(buf.toString('base64'));

const html = `<!doctype html><html><body><img src="data:image/jpg;base64,${img_base64}"></body></html>`;

http.createServer((req, res)=>{
  res.end(html)
}).listen(8080);

console.log('hello','world');
